game: main.o image.o stage.o animation.o nelib.o character.o terrain.o option.o menu.o sound.o element.o
	g++ -o game main.o image.o stage.o animation.o nelib.o character.o terrain.o option.o menu.o sound.o element.o `allegro-config --cppflags --libs`

nosound:
	CC_FLAGS="-DNO_SOUND" make

main.o: main.cpp
	g++ ${CC_FLAGS} -c main.cpp

stage.o: stage.cpp stage.h
	g++ ${CC_FLAGS} -c stage.cpp
	
nelib.o: nelib.cpp nelib.h
	g++ ${CC_FLAGS} -c nelib.cpp
	
image.o: image.cpp image.h
	g++ ${CC_FLAGS} -c image.cpp

element.o: element.h element.cpp
	g++ ${CC_FLAGS} -c element.cpp

animation.o: animation.cpp animation.h
	g++ ${CC_FLAGS} -c animation.cpp
	
character.o: character.cpp character.h
	g++ ${CC_FLAGS} -c character.cpp

terrain.o: terrain.cpp terrain.h
	g++ ${CC_FLAGS} -c terrain.cpp

menu.o: menu.cpp menu.h
	g++ ${CC_FLAGS} -c menu.cpp

option.o: option.cpp option.h
	g++ ${CC_FLAGS} -c option.cpp

sound.o: sound.h sound.cpp
	g++ ${CC_FLAGS} -c sound.cpp

clean:
	rm -f *.o
	rm -f game
